
const BASE_URL="https://manfang.xyz:8080";
export const request=(config={})=>{
	let {
		url,
		method="GET",
		header={},
		data={},
		params={}
	}=config
	url=BASE_URL+url
	return new Promise((resolve,reject)=>{
		uni.request({
		url,
		header,
		method,
		data,
		params,
		success:res=>{
			if(res.data.code===1) resolve(res)
			else{
				reject(res.data)
			}
		},
		fail:res=>{
			reject(res)
		}
	})
	
}
)}